<template>
  <div class="production">
    <div class="top">
      <!-- 顶部导航栏 -->
      <van-nav-bar>
        <template #title>
          黑马程序员
        </template>
        <template #left>
          <div class="myicon" @click="back"><van-icon name="arrow-left" /></div
        ></template>
      </van-nav-bar>
    </div>
    <div class="showprotuction">
      <van-tabs v-model="active" color="#3296fa">
        <van-tab title="作品">
          <div class="nomore">没有更多了哦</div>
        </van-tab>
        <van-tab title="公告">
          <div class="notice">
            <h4>欢迎来到黑马头条社区</h4>
            <div class="time">
              2018-10-24 24:00
            </div>
          </div>
        </van-tab>
        <van-tab title="数据">
          <div class="countdata">
            <div class="left">
              <div class="txt">粉丝数</div>
              <div>{{ count.fans_count }}</div>
            </div>
            <div class="right">
              <div class="txt">阅读数</div>
              <div>{{ count.read_count }}</div>
            </div>
          </div>
        </van-tab>
      </van-tabs>
    </div>
  </div>
</template>

<script>
import { getUserStatisticsData } from '../../../api/user'
export default {
  data () {
    return {
      active: 0,
      // 数据
      count: ''
    }
  },
  methods: {
    back () {
      this.$router.back()
    }
  },
  async created () {
    const res = await getUserStatisticsData()
    this.count = res.data.data
  }
}
</script>

<style lang="less" scoped>
.production {
  .top {
    /deep/ .van-nav-bar__content {
      background-color: #3296fa;
    }
    /deep/ .van-nav-bar__title.van-ellipsis {
      color: #fff;
    }
    .myicon {
      /deep/ i.van-icon.van-icon-arrow-left {
        color: #fff;
        font-size: 26px;
      }
    }
  }
  .showprotuction {
    height: 100vh;
    background-color: #f5f7f9;
    .nomore {
      margin-top: 10px;
      font-size: 12px;
      color: #c0b8b5;
      text-align: center;
    }
    .notice {
      margin-top: 5px;
      padding: 20px 15px;
      background-color: #fff;
      h4 {
        font-size: 16px;
        font-weight: normal;
      }
      .time {
        margin-top: 20px;
        font-size: 12px;
        color: #d6d4d9;
      }
    }
    .countdata {
      margin-top: 5px;
      display: flex;
      padding: 10px 0;
      background-color: #fff;
      width: 100%;
      .left {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border-right: 1px solid #ececec;
      }
      .right {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
      }
      .txt {
        font-size: 14px;
      }
    }
  }
}
</style>
